// server/src/routes/auth.ts
import { Router } from 'express'
import { 
  login, 
  register, 
  getProfile, 
  updateProfile, 
  changePassword, 
  logout 
} from '../controllers/authController'
import { authenticateToken } from '../middleware/auth'

const router = Router()

// 公开路由
router.post('/login', login)
router.post('/register', register)

// 需要认证的路由
router.get('/profile', authenticateToken, getProfile)
router.put('/profile', authenticateToken, updateProfile)
router.put('/change-password', authenticateToken, changePassword)
router.post('/logout', authenticateToken, logout)

export default router